//
//  Base_BlueTooth.h
//  BleGPS
//
//  Created by 盈诺森 on 2019/12/6.
//  Copyright © 2019 盈诺森. All rights reserved.
//

#import <Foundation/Foundation.h>
#import <CoreBluetooth/CoreBluetooth.h>

typedef void(^AllDeviceNameBlock)(NSArray *DeviceNameArray);//返回所有设备

typedef void(^deviceReturn)(NSData *deviceReturn);//连接成功后自动返回

typedef void(^connectionSucce)(NSString *connectionSucce);//连接成功后自动返回

typedef void(^DFUReturn)(NSString *DFUReturn);//连接成功后自动返回


@interface Base_BlueTooth : NSObject
#pragma mark  停止扫描
- (void)startScan;

#pragma mark  连接设备
- (void)centerDevice:(NSString *)uuidString;

#pragma mark  开始扫描
- (void)stopScan;

#pragma mark  断开蓝牙
- (void)disconnect;

#pragma mark  发送命令
- (void)sendCommand:(NSData *)command;

#pragma mark DFU升级
-(void)initDFUService:(NSURL *)firmWareFilePath;
//返回所有设备
@property (nonatomic, copy) AllDeviceNameBlock DeviceNameBlock;
//设备返回
@property (nonatomic, copy) deviceReturn deviceReturn;
//连接成功
@property (nonatomic, copy) connectionSucce connectionSucce;
//DFU升级
@property (nonatomic, copy) DFUReturn DFUReturn;
@end

